import axios from '../request';
import { SuerInfo, Send, PhoneCode, SuerInfo1 } from '../model/login';
interface PortalCodeType {
  phone: string;
  type: number | string;
}
// 用户登录
export const login = (params: SuerInfo) => {
  // 返回的数据格式可以和服务端约定
  return axios.post<any>(`api/portal/login/${params.account}/${params.password}`, {});
};
export const quick = (params: PhoneCode) => {
  // 返回的数据格式可以和服务端约定
  return axios.post<any>(`/api/portal/quick/${params.phone}`, params);
};
export const getUser = () => {
  // 返回的数据格式可以和服务端约定
  return axios.get<any>(`api/user/login`, {});
};
export const register = (params: SuerInfo1) => {
  // 登录
  return axios.post<any>(`api/portal/register/${params.account}/${params.password}`, params);
};
export const verification = (params: Send) => {
  // 验证码
  return axios.post<any>(`api/code/send`, params);
};
export const portalCode = (params: PortalCodeType) => {
  // 验证码
  return axios.get<any>(`api/portal/code/${params.phone}/${params.type}`, params);
};
